﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using IntraVision.Web;

namespace Model
{
    public partial class Role
    {
        public bool HasPermission(string permission)
        {
            if (Name.ToLower() == permission.ToLower()) return true;
            if (this.RolePermissions.Any(rp => rp.Permission.Alias.ToLower() == permission)) return true;
            return false;
        }
    }
}